package com.aibton.service;

import com.aibton.dao.datacenter.SysUserMapper;
import com.aibton.dao.test.UserMapper;
import com.aibton.entity.datacenter.SysUser;
import com.aibton.entity.test.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

/**
 * Created by huzhihui on 2017/7/13.
 */
@Service
@Transactional
public class InsertService {

    @Autowired
    private SysUserMapper sysUserMapper;
    @Autowired
    private UserMapper userMapper;

    public int insert(){
        SysUser sysUser = new SysUser();
        sysUser.setSysUserId(UUID.randomUUID().toString());
        User user = new User();
        user.setSysUserId(UUID.randomUUID().toString());

        sysUserMapper.insert(sysUser);
        userMapper.insert(user);

        return 1;
    }
}
